package com.bestcem.xm.user.grpc.service.converter.strategy;

import com.bestcem.bp.xm.user.grpc.v1.enums.UserEditionEnum;
import com.bestcem.bp.xm.user.grpc.v1.enums.UserIndexEnum;
import com.bestcem.bp.xm.user.grpc.v1.enums.UserStatusEnum;
import com.bestcem.bp.xm.user.grpc.v1.services.OrgWalletConfig;
import com.bestcem.xm.user.grpc.v1.enums.OrgWalletConfigRechargeLimitEnum;
import com.bestcem.xm.user.grpc.v1.enums.SsoStatusEnum;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

/**
 * 用户相关枚举转换工具
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/30 12:44
 */
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class UserEnumStrategy {

    public static SsoStatusEnum.SsoStatus ssoStatusConveter(Integer value) {
        return SsoStatusEnum.SsoStatus.forNumber(value);
    }

    public static OrgWalletConfigRechargeLimitEnum.OrgWalletConfigRechargeLimit orgWalletConfigRechargeLimitConveter(Integer value) {
        return OrgWalletConfig.newBuilder().setRechargeLimitValue(value).getRechargeLimit();
    }

    public static UserStatusEnum.UserStatus userStatusEnumConveter(Integer value) {
        return UserStatusEnum.UserStatus.forNumber(value);
    }

    public static UserEditionEnum.UserEdition userEditionEnumConveter(Integer value) {
        return UserEditionEnum.UserEdition.forNumber(value);
    }

    public static UserIndexEnum.UserIndex userIndexEnumConveter(Integer value) {
        return UserIndexEnum.UserIndex.forNumber(value);
    }
}
